<?php
require_once("lib/db_connection.php");
$completion = $_GET['completion'];
$str_value = "";
if($completion=="WorkOrder")
{
 $result_type = mysql_query("select * from lookup_workorder_tbl where company_id = '".$_SESSION['company_id']."' AND category='type'");

 while($row_type = mysql_fetch_array($result_type))
  {
   $str_value=$str_value."\"$row_type[value]\"".",";
  }
}

if($completion=="Payment")
 {
  $result_type = mysql_query("select * from lookup_expense_tbl where company_id = '".$_SESSION['company_id']."' AND category='types'");

  while($row_type = mysql_fetch_array($result_type))
  {
   $str_value=$str_value."\"$row_type[value]\"".",";
  }
}

if($completion=="None")
 {
  $result_type = mysql_query("select * from lookup_expense_tbl where company_id = '".$_SESSION['company_id']."' AND category='types'");

  while($row_type = mysql_fetch_array($result_type))
   {
    $str_value=$str_value."\"$row_type[value]\"".",";
   }
 }
$str_value=substr($str_value,0,(strLen($str_value)-1)); // Removing the last char , from the string
echo "new Array($str_value)";
?>